fix compile error on ubuntu

fix for min and max macros not being defined on Ubuntu (maybe other
debian builds).
Also fix where starttime being set through the curses interface is just
plain wrong