String formatting fixed NoneType issues