Merge "hal: fix null pointer references and data initialization errors"