[#1736] Cleaned up some const to non-const casting.