Bug fix and improved code indentation.