Resolved bugs and simplified alternations further.