Fix some import and dependency issues