More console logging and ensure first element of the tree is clicked

Also fix pop to shift (we wanted to remove the first element(s) of the
array)