LPS-46900 Make the two methods more consistent with each other and fix compile errors