Fixed bug that was introduced in previous commit.
Made fixes to coding style and documentation.