Fix parsing code