Fix instance directory

This change adds documentation for $base_dir into the comments and
fixes an issue where the value wasn't being used to create the instance