XD-1613 More flexible argument value parsing

See the test case in the diff for all the cases now handled.