Fixed an issue where moving a block from one layer to another then moving it back caused def being added multiple times.