Add end and remove warnings