Misc. bug fixes and code cleanups. Monthly invocation of http://xkcd.com/1296/