Ancient, uncommitted, untested changes to this lib.