Don't register methods when there's nothing to register.

Change-Id: I6d0233f79bb90089426d702b4076ec5750e82475