Fixed issue where pathRoot wasn't being considered.
Added test.