Added boolean 'last' variable to sem_start