configurable prefix and a couple bugs