Fix upcoming events logic. Fixes #450