Fixing a divide-by-zero bug where a ramp height is 0

Not sure if this is the cleanest way to do this - but it's possible to get into a situation where h = 0 and thus triggers a divide-by-zero bug.