Sorted out some validation problems