Updated with latest fixes for empty strings, added a clone function.