More bug correction on the same function