sync with latest cowboy, bug fixes