Include bit-offset for fields; fix memory leak