Some overall corrections to follow Ruby coding best practices.