Issue #515 completed, unit tests were added.Issue #538 completed.