Fixed few errors along with sorted search