Fixes on /dir/ref/* handlers