Fixed false match substring bug