Simulator:Fix for static analyzer reported issues