Fixes and refactoring
Added tests for parameters