Some cleanup, bugfixes for delta2, code normalization