Bugfixes. Added doc-string.