Fix template functions for move detection.