Fix a few miscellaneous issues