Fix Print JavaScript to be more compliant