Use Util.clamp instead of doubly nested ternaries, see #170