dss.c: Various small improvements and fixes.