Fixed a bug.

The elves and gremlins get all the credit. See details on the google doc
for...more details