Clean up copying of attributes at @nikic's request