Add error handling for box parsing.