Fix a few lesser issues found while debugging