Update gradle, fix some warnings, fix a bug in loading empty preferences.