Somebody (as I remember, @LorenzMeier) said that 'valid' flag is evil, isn't it? :)