Fixed invalid byte sequence behavior