Fix imports and tests