Fixes #782: Second attempt
Concerning #653: Added test script
Removed duplicate test script