Fixed some minor errors and warnings