Code cleanup and small fixes
Validation bugfix