Fixed all kinds of errors.