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 and permanent disability 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. The provision herein shall be retroactive to cover any pensioner or his beneficiary who had service in excess of twelve months for which no pension benefits were received.