Fixed import bug and other small bugs