Fix bugs introduced by recent changes.