Fixed commands not being executed due a NullPointerException