Fix cmake issue
Some cleanups and sig int handling