Improved handling of signals