Cleaned a few minor bugs, optimized imports