Add missing ENDIF and remove some spaces