Fix invalid parameters for RuntimeException, fix behavior when got SIGTERM