circle changes cherry-picked and merged
issue #510