Fix potential NullPointerException in StackMachine.java