Fix some broken valid().