Fix CalculatePlugin for working with both Rhino and Nashorn