Fix a crash, and optimize background refreshes