fix bytes being left over from malformed byte stream