Added test and fixed some formatting