Misc improvements

This change set contains miscellaneous improvements to the codebase. Please refer to each commit for further description. All tests passed.