Fixed nasty time.py bugs