Merge back branch alg_writerframes to trunk