Add functions OBJECT_LENGTH() and POLY_LENGTH()
Fix test cases