Formatting and some fixing

Formatting after PEP8 and PEP257
Fixing after what I spotted on the way
Fix fields in data

Also added some checks