Fix out-of-range error when enum is last declaration in file