Miscellaneous fixes and additions