Fix crash when passing alot of defaults

In addition clear memory to make error finding easier.