Fixed context bugs, and nested require calls bug