Bugfixes for nested environments and the let statement; better support for external editors