FIX: unintended assignment to ValueError

@larsmans this tackles the mysterious UnboundLocalError ValueError ...