some repls fixes (+opt dir)