Fixed for CastepRun to more accurately determine if a castep run has finished.  Added a test case.