Improved Tests and some small changes