[FIX] additional fixes

- [TEST] test error conditions
- [TEST] make test faster
- fix header guards
- remove MAGIC_NUMBER macro