Added support for cycles that don't involve the top-level item and did some general house-cleaning