Corrected a few small style issues
Split up test function a bit