Harden logic for marking pure as in 'has no side effects'