Fixed jshint warnings
Changed equals to endsWith to include all nested paths