multiple small fixes for NPE and other crashes
updated for rc2 build