Fixing outputs related bugs

#2781