Fixing NullPointerException in magmacubes