Fix formatting
Fix syncronization
Add null-object checking