fixes from @thomasahle