fix all the dumb bugs. this is basically working, but needs more testing before CR. for WEB-8258 +review WEBCR-111