fix test errors; decouple import from link