fix compile error and code style