Fix desync of kernel and user code