fixes for devices and templates