Check for out of memory on allocation
Fixed bugs with multiple devices loaded