JC: fixed a few bugs. beefed up the integration test by adding test on new/edit. spec passes.