backport chr() 'cannot be negative' error from Moar to JVM