Fixed a segfault problem caused by improper structure aliasing.