additional fixed from branch

additional fixed from branch. Fill some missing code