Test flushing output to print before error