Fix trailing endif