Fixing to_yaml handling