Check length of favourites before randomising. Cleaned up some whitespace