Compiler - fixed typo related to dynamic conversion
First stab at refactoring conversion code