Fixed import and minor bugs