Issue 892

Fixed up a few issues that were causing failing tests.