Some refs and small fixs + phpdocs