Handle ::invalid better