Various tweaks to attempt to fix transform bug (seems to be triggered by setParent)
Clean up of broken VS2013 autoformatting.