Fix some undefined errors