Fix for issue #169. Good catch @maimairel