BUG: ValueError was assigned as local variable!