Fix creating directory for invalid ID.