Fix basedir issues