Fix some null pointer issues in main debug class
Add support for mapping enum constants to legacy constants