Fixed bugs related to parsing