Implemented debugger support.
Refactored Ptr handling.