Fixed issue where device resources would not be created properly under some circumstances.