Grade Encode Bug Fix