Update paginate.js

Fix for handling type conversion and fixes issue #8