Miscelaneous fixes