Fix type-punned pointer issues