fixed a couple of bugs in the model parser