Changes from https://github.com/discoverygarden/sfudora/pull/16, that got lost in the fray.