Fixed #1764 - thanks @torkeld