Fixes to improve GPU support