cosmetic cleanup and type corrections