Fixes for issues with AMD drivers
Better error detection