fixed some bugs to prep for PR