Fixes linux builds

I'm not 100% sure I've maintained functionality, but it looks right to me. This lets building occur using g++-4.8, on Ubuntu 13.10.