Merge pull request #8 from msavazzi/master

fixed some bugs
Fixed error on resize