[ issue1241 ] Fixed issue #1241, still room for refactoring
Merge pull request #8 from joaopizani/master

[ issue1241 ] Fixed issue #1241, still room for refactoring