Formatting exceptions improved
Null checks implemented