fix half of issues in the KL notebook

@karlnapf 
I will fix the remaining issues related to the python codes in this week.