Fix bugs in helpers.