Fix bug where serialize was not setting the instance var.