Bug fix for output