is_valid don't always revalidate the model. Added test also.
fix whitespace and coding style
resolve test errors
update naming of validated flag