Fixed several issues of the parser