Miscellaneous fixes here and there