Fixed nesting bug