Fix for failing tests and code formatting