Issue #516 Adding tests