Lost the previous commit with fixing #3, this should replace that.