fixed the last of the'major' bugs