Sort of formatted output, some minor fixes