Fixed autotools to work with changes, fix code to actually compile.