Added check for empty completion prefix.