Fix prefix class logic