Bug fixed: prevent empty context from being written into disk.