Change error handling in chunk parser