Fixed NPE when caching a device with no commands