Fixing validation bugs