Fixed formatDoc