Fixed the problem with bad frame number reporting (also broken some features that relied on good frame positioning), and also hopefully fixed the problem with the "dirty frame".