We have to check if `$typeMap{$type}` exists before accessing it.