bug fixes for parsing engine