fixing a variety of compile time bugs