Fixed handling of location listeners.