Fixed nesting errors