fix two bugs in preferences