General testing and fixes