Bug fixes

I fixed #130, #134, #136 and #137