Switch to using format instead of concatenation
Fix numerous bugs