Major fixes - all tests pass!