Some minor changes and cosmetic fixes
Some minor changes to improve validation