Added code to check for corrupted matlab results