Fix some bugs from the HP refactor