fixed a regression with constructing params from a function and wrote a test for this case