fix pointer alignment errors