Fixed errors in new, untested library code.