Fix bug in favorites handling