fix merging problems and missing null check for inheritedBy
Merge branch 'master' into clean_up