Fixes runtime crash bug and adds tests for signals