Additional tests and fixes