Fixes some segfaults with invalid arg params