Fixed compiling and linking errors.