Add periodic command, and other improvements