Bug fixes in background kernel script and updates the tutorial and unit tests

update