Workaround for bug in to_yaml method