Use SourceFile param in import()
Rewind stream from EntityBody
Add some type casting