Fixed nullpointers when running on real device