Fix some problems in first version