fixed more issues with branch merge 3.1