Fix a bit of undefined behavior in the nacl code