Made all doctest pass.