Fix undefined year_end and make frontend graphs work without pretty permalinks