Fix invalid function argument handling

This is related to #23.