fix for 2 null pointer related bugs and 1 bitmap related bug