Enumeration Correction in C-Interface

Following issue #144.
Also I would like to have a test for the bug. The standard procedure should be: 

1. a bug is reported
2. bug is reproduced in (failing) unit test
3. bug is fixed and thus the unit test

Can you please add this test (a new test case)? 

Thanks.