Fix unbound variable $f