Fixing 1285 and 1287

--HG--
extra : source : bfcddd097a9bd09f056b04efa7f361d92d89556f