improved method signature detection, fixes #58