Fixed bug in constant-detection.