Fixed bug in get_msg: timeout is a pointer and was being passed to memcpy as if it were the regular struct