Fixed a few issues spotted on github.