Fix some bugs introduced by method refactoring