Added all code, kernelsp getting clobbered in app_startup()