changed newline handling in genlab.js