fix basepath and path call to use ontology-version

In order to prevent problems call basepath and path on
the version if possible.
fix io and codepath comments.
add file-type comment.