Add missing endif, remove extra endif

Change-Id: Ife3959a925e93564155932204480ebb12e2bae53