Updated to fix a couple of bugs and to use the new module.