Fixed bug with kwargs not being passed correctly