Fixed a bug when search tried to fetch messages even when there were no found UIDs