fixed #293
added a test for bug #244 - unfortunately it doesn't reproduce the problem