Fix problems found with coder and codesniffer. Clean docs.