Fixed minor bugs, added time range setting