Fixed debug and missing NameBuilder reference
Refactored some code.
Merged Master