fixing bugs (mostly missing imports)