Fixed a few validation bugs