Fix broken variable and add missing documentation