fix compiler and linker errors