Fix object initialization and tests