Merge pull request #14 from eyscode/master

Fix the source of the bug #12, and fix a new regarding bug on resize.
Merging fixes from @eyscode.