fixes as proposed by @cschuster