Additional options, command line flags and sync. locks

this can and most of the time will be nil. Please move this part of the change to a new PR, I don't want to block the other changes