Added config functionality and minor tweaks.