Upgrade dependencies

Closes #1843