Resolve a few  issues to fix #478
Reformat files