Fixed setError call. closes #340