Properly support multi-type devices
Tweaks for easier MSVC support