Fix some errors, move import