Improve signal handling