Fixing errors from switch to tree pointers.