Added validation to lib.