Added typechecks.