Updated to work with latest stand alone code