Better error handling. Improved Gate operator.