BUGFIXES: several bugs fixed and typos, too