Fixed logic error in calculation of layerElev (layer range) in twttToElev function.