cleanup: codingguidelines and little bugfixes
codingguidelines cleanup and little fixes