Fixed bug #3489

The code assumed that two global variables would be constructed in a particular order, but global variable initialization order is compiler-dependent. On CentOS 6.5, this bug caused a segmentation fault.