S100 fixes from c10ud:
http://chdk.setepontos.com/index.php?topic=650.msg99709#msg99709