General stuff that could (and probably should) be integrated into prog/lib.
