Quantify free vars

I did not bother to make a separate pull-request for both commits.
Please review