fixed bug with empty obj contracts, improved tests