Fixing an "index out of range" error thrown in testing

Code reviewed by Trilok. Basic premise - logs were being searched for strings that weren't there, and then trying to be indexed, throwing an error. New functions were implemented that encapsulate the failing calls in a try-catch block.