more fixes for 64bit issues and regressions