Fix bug: closing time was calculated incorrectly for midnight-crossing blocks
Fix small issues with formatting of data