fixing two issues Max found

--HG--
extra : source : 22fefaa0a475a099671335825e22c3464f5d9147
Merge pull request #570 from einhverfr/master

fixing two issues Max found