Fixed some serious problems and introduced others.