Finally able to get rid of almost all warnings, one more to go