Fixed optional arg handling

Was committed in a half-written state.