Some typo fixing and variable renaming
Can now map types with complex sub-types