Add some functions to get number of frames and generated parameters. Fix tiny bugs.