Better error handling on parsing frames