Fixed class use in headers and minor bugs