Ptc/fix compiler errors

These changes fix compiler errors on Debian/wheezy and allow parrot to build again.

Comments welcome.