Fixing a few issues

This gets the model to run in OpenModelica (still need to test SystemModeler)