fixes for file length for the in-memory files
fixes for asynchronous exceptions