Fixed bug in sunrise/set check