Fix duplicate item id errors from bad collection iteration
Fix formatted page title logic to prevent PHP warnings