(minor) JS path fix and minor code cleanup