Fixed up some signals stuff and added a test for signals.