Fixed a bug in the sonar class.