Fix several mistakes