Autoincrease ID, Fix DeviceProperty error, etc.

More reliable and proper logging.