Add some validation for 'mode' option