Fix bug resulting in many errors in production