Fix bug in title plan grid cut calculation
Add margin in title plan generation