Fixed radius calculation when creating circle and did some refactoring.