Bug fixes and test updating (so things pass tests now!)