Fix basedir initalization