Fixing bug in parsing