some bug fixes
Merge pull request #40 from diegosarmentero/master

some bug fixes