A few miscellaneous fixes