Added tests from other pull request