Fix issue 23: most files stop early

State machine was messed up, copied updates from ogv.js :D