fixed issue with references to merged vertices