Remove deprecated method calls. Fix #165.