Fix corner-case in invalid utf-8 detection, with modified test-cases. Additional test-cases still to be done.