Fix imports and restrict available legacy imports