Added testing for error in to_yaml. Can't get test for file dump to work...