Fixed #67 and did some more work on #63.