Fix segfault due to doubly registered resource and fix error logging when device could not be added