bug 1236: Use single assignment for global variables
bug 1236: Corrected showdetail handling