Miscellaneous fixes and pipe unwrenching cleanup.

Small things.  See the issues mentioned in the commits.
Also cleans up the code for unwrenching pipes and other atmospherics objects.