fix some bugs found during load testing