Fix NullPointerException while processing OptionalParameters