Fix UID parser, omit blank UIDs, some PEP8 fixes