explicit cast
Check for errors in first output from setmode