Add guard against empty locstrings, remove debug prints