Slightly updated signal handling