add validateSync and small improvements

Keep semi-colons at end of function defs please