Adding a test case for #588 which reliable reproduces the issue
Adding a missing EXPORT declaration