Bug fixes to some of the methods, plus additional tests