Improved bot check logic.
Initial checkin.