Code review and bug fixes in parse.rs