Fix error with EmptyQueryset