Fix issue #30 and #32

I forgot to sync my fork with your repo before commits and automatically merge doesn't work. I'm not sure how to fix that.