test for ticket 256 and small bugfixes