Fixed code format and added test