Change canMerge() method to throw exceptions upon failure