fixed errors in object namespace

and added tests