Updated tests and fixed some errors.