Fix deprecation warning. Closes #1