bug fixes and tweaks
Merge branch 'cycle'