Code cleanup and fixed minor bugs²
Code cleanup and fixed minor bugs²