Fix Yap crash and optimize location fetches