Attempt to fix NPE in test emulator