bugs found by Greg Hunt fixed