Fixing bug in frame rate implementation