Fixed Null Pointers, added test commands