don't dump an empty hash in the success case
reorder code for a bit of efficiency
unweaken was only added a few months ago; use dualvar instead