added pest subdir support and masterpath bug fix