VE-1406 and VE-1074 Fixes and optimizations