Fix day/night bug, and agent offset