Several bugs fixed. More changes.