Fix issues with context lost on Android