Fix for instance_{fieldname} bug.
Converted imports to relative imports and a few PEP8 spacing fixes.