Added tests for parsing empty files, fixed errors