Switching time optimization for nonlinear switched systems: Direct optimization and the time-scaling transformation