Forced Javascript into strict mode and fixed bugs related to that change