Fix bugs in creating visual objects.