Oh, wait.
There was a bug with code limit stuff and ucs-2.
Here's the fixed version.