Add more testing and fixes