Fix bug re titlepos in panel func