Added a condition for CF on Encode Parameters; Code Cleanup;