Minor code cleanup and print dimensions on exit