Add validation/error reporting to VQB. Fix #147.

i don't get what this function does