phpDoc and code fixes