Fixing preferences loading bug