Fix #851 and #852: Fix case issue and objectification of error