Test fixes and new tests