Fix php warning on 5.2.x
More optimized queries for book sections