Fix cut-and-paste bug