Fixed bug with early times and wrote test