various HW2 bug fixes