Add detection of division by zero for constants