Removed usage of deprecated methods. Minor code clean-up from warning (fixes #885)