Working regularization. Many undocummented changes.