Removes orphan endif