add more tests and fix object type checking