Fixed errors, non-used imports, and non-used variables