Fixed error reporting, stack cannot be relied on client side