Fixed broken validation method. TODO: some tests around this.