BUGFIX: fixed critical bug in update_kernel(...) code