bugfixes, auto-training, makefile