HAL example; various minor fixes