Little update

I made a couple fixes because I want to use this shaper in production. My first pull request, hope it is OK.