Fix problem with nesting backwards