Add last page log
Create logs for lastPage function
Fix lastPage calculation
Add spaces to rich text templates