Fold constants (fix #504)