Fix bug in preferences initialization