Fixed SynchronousInvocationHandler and added a test