Fixed namespaced enums related errors and improved error handling