Make tests CLI-friendly, use strpos correctly