replaced wrong call to getCanonicalName to getName and added test