Congested speed : unit conversion

Hi

My congested speeds on very high, which I am able to trace back to incorrect unit conversions or the absence of it. I have distance in m, speed in km/h. For the travel time calculations, I am using the script file to convert my distance to km. However, the congested speed calculations are bypassing this distance in km value and still calculating in m. 

Probably I am missing some best practices. How may I rectify this ?

Thank you

Ram