Added tests for story 4 (fixes #31).