Redirect to root after switching branch, remove debug printout