Debian fix

This fixes two issues, one that @StrangeWill reported, and one that I experienced after reinstalling the project on debian 7 x64. It was mostly just updating some libraries to later versions.

Please test on other platforms before merging.