Fixing stdout bug