MockOutput had a nested while loop, but it wasn't needed. Also tidied some of the error handling in MockOutput. #story[1095]