Fixed nesting bug. Added tests. Version bump.