Possible fix for #170: Might have broken something, @kohlhase please test