Cleanup, fix a few potential issues and inconsistencies