Updated some type checking