Added tests and format fix