This should definitively fix frames out of range.