Fix bug where kwargs were not expanded