fix one line bug and simplify some stuff
Merge pull request #1 from olivierlambert/master

Fix some issues