Fixed small bug in preference reading.