final bugfixes for study