fix coding and import errors