opts.root was never applied before

I changed the order of how `opts.root` was assigned, so it can override default values.