test improvements and fixes