Make depth a signed value
Remove old unused static function