Search: Fixed indentation, don't search when directory or text aren't defined