Add in a prefix option. Fix some misc bugs.