Corrected bug in handling of pattern bindings.
Corrected environment for as-pattern.