Fixed bug #3489

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