Fixed NullReferenceException
Fixed device commands not being read.