Fix trailing "end"