Added validation for internal representation after every modificaiton.