Fix some bugs, add some features to handle timing and configuration variables