bug fixes and random changes