Fix #536: Check type of arguments to exported methods