Fix argument order and add tests