Fixed some errors with create_instance
Fixed some errors with create_instance