Search handler made configurable and some bug fixes