Small fixes.

I had to make a few small changes to get this working on Debian Wheezy.