Fixing a few issues

This gets the model to run in OpenModelica (still need to test SystemModeler)
This script can be used to test things in OpenModelica.