Fixed memory leak with copy/paste parameter

+ Automatically set UI ranges based on number of discrete values