added support for errors in depth and in arrays