Fixed bugs and better performance.
Merge pull request #2 from jkbnerad/master

Fixed bugs and better performance.