Cleanups and fix build warnings