Use a single function for creating new ['a ty]s.

This fixes #16.

@gasche: your previous commit didn't compile.