Fixing kwargs bug described in #429

This reverts commit b776c6d42177c09e29fb191a2803300a79922608 and fixes #429.