Correct output of #valid? method to boolean