fixed compile error and warning