Compiles on GCC, fixed the gcc warnings.