Cleanup all code to remove some warnings