merge Chandra's changes, clean up tests