Handle malformed packets more gracefully