Fix error when preferences are still not set