Fixed assumption that stdout always has clearLine method