Fixed up lots of complier warnings and some general cleanup