update Max GOP size and minor fixes for early return
minor fixes for writting format
Merge pull request #188 from ruil2/MaxGOPSize_update

update Max GOP size and minor fixes for early return-- review request#59