Fixed a nasty nesting issue