Fix to #160

Fix for #160. Please review and merge