Fixed object reference issues