Fix some jshint warnings

Three warnings
55	Use '===' to compare with '0'.
99	Use '===' to compare with '0'.
111	Don't make functions within a loop.