Adds check for invalid removeListener arguments.