Made fix that @samx suggested and added test for it