Added scoping for more advanced statements.