New identifyForm function (fixes #649).

Based on code from @axel-angel but rewritten in a more lightweight
style (IMHO, at least :).
Typo.