bug fix: reference initialized to a temporary object

With g++ 4.7.2 and under -O2, some of the code was optimized out due to the bug in the code, resulting in malformed packets being sent out.