Bug fixes

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