fix error checking in dev.set