Fix issue #20

Thanks to ricardofbarros for its patch