Removed usage of directory local variables.

Fixes #12 and #42.