fixing a number of bad includes + inconsistent signal handling + bad header guard