Update primenos.js to fix incorrect boundary checking