Update ranger.lua

Fixed functions that did not return properly.