Change num_instances to a float

Integer division floors the result to 0, so any *_percent condition will always evaluate to true