Additional fixes

This fix adds a function to be used within loops to make jshint happy.