couple of bugs fixes
Merge pull request #1521 from diegosarmentero/master

couple of bugs fixes