Changed a little logic in reading preferences