Fixes signal handling