fix errors

fix the import errors and several simple problems