Attempt at fixing some errors and forgotten includes