Fix bug in output