Many code fixes.