Improved parsing checks
Minor bug fixes