fix gcc 4.8 incompabilities

* previous code was throwing the following:
call is the same expression as the destination; did you mean to dereference it? [-Wsizeof-pointer-memaccess]