null pointer + sizing issues fixed