Fixed the incorrect rotation being applied when attaching an object.