Lot of bugfixes from compiler errors.