Fixed detected errors and problems