Miscellaneous fixes