fixed tons of compile bugs