Fixing 1285 and 1287

--HG--
extra : source : bfcddd097a9bd09f056b04efa7f361d92d89556f
Merge pull request #549 from einhverfr/master

Fixing 1285 and 1287