Replaced print statements

This is for #256. This change ensures that the error message are visibile in the simulation interface.
Removed debugging statements

This is for #256. If they should be present, then the function needs a 'debug' flag, and ModelicaMessage should be called rather than printf
Removed unused variable