Fixed bug in case there was no plt
Added a replacement for time.sleep which does not return on signals