Added signature tests, fixes small bugs discovered during testing.