Make sure we initialize attributes properly on thread (bug #1563)