Fix doctrine mapping warnings
Completed unit tests and bug fixes for variable replacements