add more tests for custom parameter order and fix some bugs