Fixed user tasks getting run in kernel mode when they are run for the first time and added debugging statements