fixed some minor stuff: output and missing var