Bug fix; closes #41