fixed misleading comments; cleanups; fixed a bug in bms_duration.