Fixed bug with objects