Reverting last patch as the cast is not necessary.