Some fixes to library importing