Re-fixed #203
Merge pull request #213 from objcow/master

#203 (2nd attempt)