Fixed all compiling errors. Only have to deal with linking errors now.