Avoid using inconsistent pointer data

I get some occasional crashes in the SlidingMenu due to some devices returning odd values, this patches fixes those crashes (ignore the interim commits that do nothing)