Fix assembling of optional parameters, fixes #49