Minor revision to handle situation when net_idx = 0 and/or output_scale=0