Added error checking to yaml file loading.