Many bug fixes. Environment redefined.