Additional fixes for safe_eval