Fix conflicts between wp-cli branch and issue-49

Merges #423 and #236