bug fixes

should of caught these by running tests