small bug fixes and code cleaning
Merge pull request #26 from BFALacerda/master

small bug fixes and code cleaning