Copy fix from Mayhem, hopefully I didn't break anything