Fixed missing ends