Added some tests and fixed some warnings.