Fix for #1319 including tests

This solves #1319 issue. Pull request also includes tests as well as my name added to the credits docs page.