Code Revisions

A multitude of miscellaneous changes.