Fix ReferenceError with chapters