Add some type checking