Small bugfixes from John Thiltges.