Fixing nesting issues