Fixed error reporting for cycles.