Fix some bugs in core preferences model