Fixing search static buffer and const-ifying non-const pointer