Adds fixes according to hlint.
Adds function documentation.