Fix some warnings and errors caused by the previous commit. re #34