adding fixes and tests