Made some changes. Should work now.

Committing before I can test.