Cleaning up some errors and formatting