Landing a bunch of bug fixes from furf's pull request at eefcbaebb31b89b5eb360cd5ec61...