Backport fixes and features from Digest

This is a bulk request for all fixes present in Digest but not in Brief. It is v1, so if needed I'm ready to fix/comment patches and/or split them up into separate pull requests.