Fix bug with transient value casting
Merge branch 'master' into gui_K