Fixed KeyError when updating blocks