Fix some minor bugs that caused parsing to fail.