More minor fixes for stable release 4

Addresses issues that came to our attention recently: #167, #1021, #840, and a server error reported by Granite Hills.