pull to embr r96
Merged from embr r96
cleanup after merge
some more clean and fix
adjusted some funcs and fixed several bugs of the merge from r96
missed this stupid bug