Silence some warnings from PHP, fix broken arrays (rarity) in date logic