Night timing update and numerous bug fixes