Fix #125 - correct last page calculation
Fix JSHint warnings