Fixed some imports and type checkings.