Initialization order fixed, added DEVICE macro
Initialization order fixed, added DEVICE macro