Vulnerability model validation

Some bullet-proofing and bug fixes related to https://bugs.launchpad.net/openquake/+bug/1157072.