Hard and Soft constraint fixes.
Added clone function.