Add some check methods, fix some bugs