Added a check if time is specified to avoid a segfault, fixed some other issues