When any member shall be compelled to retire because of age or disability, or shall die, fractional parts ofyears shall be counted in determining the number of years of service with respect to the member being compelled to retire because of age before completing the required number ofyears of service, and with respect to partial pensions and pensions for total permanent disability arising outside of police duties and not in line of duty, or pensions upon death, and thereafter such member or his beneficiary shall be entitled to receive a refund of all amounts deducted from his salary for pension purposes for any months for which he or his beneficiary cannot receive full credit on pension benefits.