#484 measure problems on gingerbread

Here are some changes that fix problems discovered on Sony Xperia with Gingerbread and other GB devices in some circumstances.

Don't hesitate to contact me for details.

I guess it also fixes #807.