Added contracts for GetNumDevices method.