fix bugs so code can compile.