Fixed objectives
Added code for stopping simulation after objectives are completed or
failed