Fix library check in and search bug.