Fix Appendix, added unit tests