bug fix: optional arguments were not properly handled in some cases [huge bug]