Fix prefix to handle nil properly