add tests for bugs fixed in #811

closes #813