Fixed tests and all compilation errors.