Various fixes for preferences