Fixed memory corruption bug by explicitly initializing the pointer to null.
Fixed triggering exception in declaration converting by handling the declaration first.