Fixing a bug with window.nsiId. Renamed some methods