Changes to add const into the getNextFrame() method. (as suggested by James)