Fixed bug where loopdir would cd out of a directory even if it had failed to cd into it. Also, fixed a bug where the variable f was not being unset, but rather $f (the variable named by the value in the variable f).