Improve handling of nested objects given as params

relates #223